# -*- coding: utf-8 -*-
# @File     : validators.py
# @Author   : bingjia
# @Time     : 2020/8/11 10:31
# @Desc     :

from operation.base.api import serializers


class DefectValidator(serializers.Serializer):
    """
    缺陷验证
    """
    project_id = serializers.IntegerField()
    defect_name = serializers.CharField(max_length=128)
    location = serializers.CharField(max_length=64)
    shoot_date = serializers.DateTimeField()
    thermal_path = serializers.CharField()
    visible_path = serializers.CharField()
    defect_image_path = serializers.CharField()
    model_info = serializers.CharField()


class DefectTypeValidator(serializers.Serializer):
    """
    缺陷类型验证
    """
    # project_id = serializers.IntegerField()
    # defect_name = serializers.CharField(max_length=128)
    # location = serializers.CharField(max_length=64)
    # shoot_date = serializers.DateTimeField()
    # thermal_path = serializers.CharField()
    # visible_path = serializers.CharField()
    # defect_image_path = serializers.CharField()
    # model_info = serializers.CharField()


class CheckConfigValidator(serializers.Serializer):
    """
    检测配置验证
    """
    name = serializers.CharField(max_length=128)
    output = serializers.CharField(max_length=128)
    img_size = serializers.IntegerField()
    conf_thres = serializers.FloatField()
    iou_thres = serializers.FloatField()
    model_info = serializers.CharField(max_length=128)
